#include <stdio.h>

int main() {
    int n, location, index = -1, max = 0, min = 0;
    scanf("%d", &n);
    int a[n];
    for (int i = 0; i < n; i++) {
        scanf("%d", &a[i]);

    }
    int num = 0;
    scanf("%d", &num);
    for(int i = 0; i < n; i++) {
        if (a[i] == num) {
            index = i;
            
        }else if (a[i] > num)
        {
            max++;
        }else if (a[i] < num)
        {
            min++;
        }
        
    }
    printf("%d\n", index);
    printf("%d\n", max);    
    printf("%d\n", min);
}
